<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Gets the query, fields, limit, and skip for this cursor</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongocursor.immortal.html">MongoCursor::immortal</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongocursor.key.html">MongoCursor::key</a></div>
 <div class="up"><a href="class.mongocursor.html">MongoCursor</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mongocursor.info" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoCursor::info</h1>
  <p class="verinfo">(PECL mongo &gt;=1.0.5)</p><p class="refpurpose"><span class="refname">MongoCursor::info</span> &mdash; <span class="dc-title">Gets the query, fields, limit, and skip for this cursor</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongocursor.info-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><strong>MongoCursor::info</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   This can be called before or after the query.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongocursor.info-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongocursor.info-returnvalues">
  <h3 class="title">返回值</h3>  
  <p class="para">
   Returns the namespace, limit, skip, query, and fields for this cursor.  
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-mongocursor.info-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>1.1.0</td>
       <td>
        Added a number of other fields, including <em>id</em> (the 
        cursor id), <em>at</em> (the driver&#039;s counter of which 
        document is current), <em>numReturned</em> (the number 
        returned by the server in the current batch), and 
        <em>server</em> (which server the query was sent 
        to—useful in conjunction with
        <a href="mongo.readpreferences.html" class="xref">Read Preferences</a>.
       </td>
      </tr>

      <tr>
       <td>1.0.10</td>
       <td>
        Added <em>started_iterating</em> field, a boolean indicating
        if cursor is pre- or post-query.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-mongocursor.info-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-1452">
   <p><strong>Example #1 <span class="function"><strong>MongoCursor::info()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$m&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">MongoClient</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$cursor&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$m</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">foo</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">bar</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">find</span><span style="color: #007700">(array(</span><span style="color: #DD0000">"x"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">4</span><span style="color: #007700">),&nbsp;array(</span><span style="color: #DD0000">"y"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cursor</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">info</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents"><p>以上例程的输出类似于：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
array(5) {
  [&quot;ns&quot;]=&gt;
  string(7) &quot;foo.bar&quot;
  [&quot;limit&quot;]=&gt;
  int(0)
  [&quot;skip&quot;]=&gt;
  int(0)
  [&quot;query&quot;]=&gt;
  array(1) {
    [&quot;x&quot;]=&gt;
    int(4)
  }
  [&quot;fields&quot;]=&gt;
  array(1) {
    [&quot;y&quot;]=&gt;
    int(0)
  }
}
</pre></div>
   </div>
  </div>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongocursor.immortal.html">MongoCursor::immortal</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongocursor.key.html">MongoCursor::key</a></div>
 <div class="up"><a href="class.mongocursor.html">MongoCursor</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
